package  wibrst.utils{
	import flash.external.ExternalInterface;
	import flash.system.Security;
	/**
	 * ...
	 * @author wibrst@qq.com
	 */
	public class JsUtil{
		public static function get currentURL():String {
			var url:String = "???";
			setDomain("*");
			if (ExternalInterface.available) {
				try {
						 url = ExternalInterface.call("function(){return location.href;}");
				}catch (e:Error) {
						trace("JSFunction::getCurrentURL->", e.message);
				}
			}
			return url;
		}
		
		public static function setDomain(domain:String):void {
			Security.allowDomain(domain);
			Security.allowInsecureDomain(domain);
		}
	}

}